﻿<phone:PhoneApplicationPage 
    x:Class="Qplus.UI.SearchFriends"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    xmlns:my="clr-namespace:Qplus"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:UI="clr-namespace:Qplus.UI"
    xmlns:c4f="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls">

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--枢轴控件-->
        <controls:Pivot >
            <controls:Pivot.Title>
                <TextBlock Text=""/>
            </controls:Pivot.Title>
            <!--枢轴项一-->
            <controls:PivotItem Margin="0">
                <controls:PivotItem.Header>
                    <TextBlock Text="推荐" FontSize="30" Width="140" HorizontalAlignment="Center" />
                </controls:PivotItem.Header>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="400"/>
                            <ColumnDefinition Width="80"/>
                        </Grid.ColumnDefinitions>
                        <ListBox Visibility="Collapsed" Grid.Column="0">
                            <Grid Name="recommendGrid" ShowGridLines="True">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="200"/>
                                    <ColumnDefinition Width="200"/>
                                </Grid.ColumnDefinitions>
                            </Grid>
                        </ListBox>
                    <ListBox x:Name="rlist" Visibility="Visible">
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <toolkit:WrapPanel></toolkit:WrapPanel>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <UI:FriendControl UserID="{Binding userID}" UserName="{Binding userName}" UserLevel="{Binding userLevel}"
                                                  HeadType="{Binding headType}" HeadValue="{Binding headValue}"/>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <my:ButtonEx x:Name="refreshRecommendBtnEx" Width="80" Height="80" BorderThickness="0"
                                 Grid.Column="1" VerticalAlignment="Top" Click="refreshBtn_Click">
                            <my:ButtonEx.Background>
                                <ImageBrush ImageSource="/Qplus;component/Pic/refreshnormal.png" Stretch="None" />
                            </my:ButtonEx.Background>
                            <my:ButtonEx.PressedBackground>
                                <ImageBrush ImageSource="/Qplus;component/Pic/refreshfocus.png" Stretch="None" />
                            </my:ButtonEx.PressedBackground>
                        </my:ButtonEx>
                    </Grid>
            </controls:PivotItem>

            <!--枢轴项二-->
            <controls:PivotItem Margin="0">
                <controls:PivotItem.Header>
                    <TextBlock Text="搜索" FontSize="30" Width="140" HorizontalAlignment="Center" />
                </controls:PivotItem.Header>
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="400"/>
                        <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>
                    <ListBox Grid.Column="0">
                        <Grid Name="searchGrid" ShowGridLines="True">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="200"/>
                                <ColumnDefinition Width="200"/>
                            </Grid.ColumnDefinitions>
                        </Grid>
                    </ListBox>
<!--
                    <my:ButtonEx x:Name="refreshSearchRsultBtnEx" Width="80" Height="80" BorderThickness="0"
                                     Grid.Column="1" VerticalAlignment="Top" Click="refreshBtn_Click">
                        <my:ButtonEx.Background>
                            <ImageBrush ImageSource="/Qplus;component/Pic/refreshnormal.png" Stretch="None" />
                        </my:ButtonEx.Background>
                        <my:ButtonEx.PressedBackground>
                            <ImageBrush ImageSource="/Qplus;component/Pic/refreshfocus.png" Stretch="None" />
                        </my:ButtonEx.PressedBackground>
                    </my:ButtonEx>
-->
                    <UI:SearchControl x:Name="searchCtrl" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    <Button Name="testBtn" Content="test" Visibility="Collapsed" Grid.Column="1" VerticalAlignment="Bottom" Click="testBtn_Click" />
                </Grid>                
            </controls:PivotItem>

            <!--枢轴项三-->
            <controls:PivotItem Margin="0">
                <controls:PivotItem.Header>
                    <TextBlock Text="在线" FontSize="30" Width="140" HorizontalAlignment="Center" />
                </controls:PivotItem.Header>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="400"/>
                            <ColumnDefinition Width="80"/>
                        </Grid.ColumnDefinitions>
                    <ListBox>
                        <toolkit:WrapPanel x:Name="onlineWP">
                            
                        </toolkit:WrapPanel>
                    </ListBox>
                        <ListBox x:Name="onlineList" Visibility="Collapsed">
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <toolkit:WrapPanel></toolkit:WrapPanel>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <UI:FriendControl UserID="{Binding peerID}" UserName="{Binding peerName}" UserLevel="{Binding peerLevel}"
                                                  HeadType="{Binding headType}" HeadValue="{Binding headValue}"/>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <my:ButtonEx x:Name="refreshStrangerBtnEx" Width="80" Height="80" BorderThickness="0"
                                     Grid.Column="1" VerticalAlignment="Top" Click="refreshBtn_Click">
                            <my:ButtonEx.Background>
                                <ImageBrush ImageSource="/Qplus;component/Pic/refreshnormal.png" Stretch="None" />
                            </my:ButtonEx.Background>
                            <my:ButtonEx.PressedBackground>
                                <ImageBrush ImageSource="/Qplus;component/Pic/refreshfocus.png" Stretch="None" />
                            </my:ButtonEx.PressedBackground>
                        </my:ButtonEx>
                    </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <!--演示 ApplicationBar 用法的示例代码-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="按钮 1"/>
            <shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="按钮 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="menuItem1" Text="菜单项 1"/>
                <shell:ApplicationBarMenuItem x:Name="menuItem2" Text="菜单项 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->
    
</phone:PhoneApplicationPage>